﻿@using Gx.Model.ViewModel;
@model LKWarehouseAdjustDto
@{
    ViewBag.Title = "编辑商品调仓单";
    Layout = "~/Views/Shared/InfoMaste.cshtml";
}

<script src="~/Js/Global.js?v=20240706"></script>
<script type="text/javascript">
    $(function () {
        InitCustomer();
        $('#sbIsByTon').switchbutton({ checked: @Html.Raw(Model.WarehouseAdjust.IsByTon ? "true" : "false") });
        $('#CustomerId').combogrid('setValue', { Id: '@Model.WarehouseAdjust.CustomerId', CustomerName: '@Model.WarehouseAdjust.CustomerName' });
    });

    function addDom() {
        var customerId = $("#CustomerId").combobox('getValue');
        if (customerId == "") {
            Helper.Show("请选择客户");
            return;
        }
        $('#dlg').dialog('open').dialog('setTitle', '引导式调仓');
        $('#dg').datagrid('load', {
            CustomerId: customerId
        });
        initDom();
    }

    function delDom(domId) {
        $("#" + domId).remove();
        removecalculateWeight();
    }

    function addDom2() {
        var domId2 = $("#CostDomNum").val();
        $.post("/GoodsOrder/_AddLKWarehouseEntryCost", { domId: domId2 }, function (html) {
            $.messager.progress('close');
            $("#costgird").append(html);
            $.parser.parse($("#CostTr" + domId2));
            InitCostTypesCombogrid2(domId2, initCostType);
            InitChargingUnitCombobox(domId2);
            $("#CostDomNum").val(Number(domId2) + 1);

            initDom();
        });
    }

    function delDom2(id) {
        $("#CostTr" + id).remove();

        //domId2 = Number(domId2) - 1;
        removecalculateAmount();
    }

    var costdom = new Array();
    var detaildom = new Array();

    function initDom() {
        costdom.length = 0;
        detaildom.length = 0;
        $("input[type='hidden'][id^='CostDomId']").each(function () {
            var d = $(this).val();
            if ($.inArray(d, costdom) === -1) {
                costdom.push(d);
            }
        });
        $("input[type='hidden'][id^='DetailDomId']").each(function () {
            var d = $(this).val();
            if ($.inArray(d, detaildom) === -1) {
                detaildom.push(d);
            }
        });

    }


    function querycustomer2() {
        $("#CustomerId").combogrid("grid").datagrid("reload", { "Customer": $("#SelectCustomerText2").val() });
    }

    function selectEntryDetail() {
        var detail = $('#dg').datagrid('getSelected');
        if (detail == null) {
            Helper.Show("请选择商品");
            return;
        }
        var domId = $("#DomNum").val();
        $.post("/GoodsOrder/_AddLKWarehouseAdjustDetail", { domId: domId }, function (html) {
            $.messager.progress('close');
            $("#detailgird").append(html);
            $.parser.parse($("#" + domId));
            InitInWareHouse(domId);
            initAdjustDetail(domId, detail);
            $("#DomNum").val(Number(domId) + 1);
        });
        var id = domId - 1;


        $('#dlg').dialog('close');
    }
    function initAdjustDetail(id, detail) {
        $("#GoodsNo" + id).textbox('setValue', detail.GoodsNo);
        $("#GoodsId" + id).val(detail.GoodsId);
        $("#GoodsName" + id).textbox('setValue', detail.GoodsName);
        $("#GoodsSpecId" + id).val(detail.GoodsSpecId);
        $("#GoodsSpecName" + id).textbox('setValue', detail.GoodsSpecName);
        $("#Weight" + id).numberbox('setValue', detail.Weight);
        $("#Number" + id).numberbox('setValue', detail.Number);
        $("#PlateNumber" + id).numberbox('setValue', detail.PlateNumber);
        $("#Area" + id).numberbox('setValue', detail.Area);
        $("#TonWeight" + id).numberbox('setValue', detail.TonWeight);
        $("#InventoryNumber" + id).numberbox('setValue', detail.Number);
        $("#OutHouse" + id).val(detail.WareHouseId);
        $("#OutHouseName" + id).textbox('setValue', detail.WareHouseName);
        $("#EntryTime" + id).datebox('setValue', detail.ProductionDate);
        $("#Remark1" + id).textbox('setValue', detail.Remark1);
        $("#Remark2" + id).textbox('setValue', detail.Remark2);
        $("#Remark3" + id).textbox('setValue', detail.Remark3);
    }

    function InitInWareHouse(domId) {
        if (domId == undefined) {
            domId = "";
        }
        $('#InHouse' + domId).combotree({
            url: "/BasicManage/GetHouseComboxTree",
            editable: false,
            valueField: 'Id',
            textField: 'WareHouseName',
            onSelect: function (rec) {
            }
        })
    }


    //计算总重量
    function calculateWeight() {
        initDom();
        var triggerControl = this;
        var value = $(triggerControl).numberbox('getValue');

        //获取triggerControl的id的最后一个字符
        var id = $(triggerControl).attr("id");
        var lastChar = id.substr(id.length - 1, 1);
        var number = $("#Number" + lastChar).numberbox('getValue') * 1;
        var weight = $("#Weight" + lastChar).numberbox('getValue') * 1;
        var tonweight = (number * weight.toFixed(4)) / 1000;
        $("#TonWeight" + lastChar).numberbox('setValue', tonweight);

        var totalton = 0;
        var total = 0;
        detaildom.forEach(function (value, index) {
            var i = value;
            var numbers = $("#Number" + i).numberbox('getValue') * 1;
            var weights = $("#Weight" + i).numberbox('getValue') * 1;

            var tonweight = (numbers * weights.toFixed(4)) / 1000;
            totalton += tonweight;
            total += numbers;
        });
        $("#TotalTon").numberbox('setValue', totalton);
        $("#Total").numberbox('setValue', total);
    }

    function removecalculateWeight() {
        initDom();
        var totalton = 0;
        var total = 0;
        detaildom.forEach(function (value, index) {
            var i = value;
            var numbers = $("#Number" + i).numberbox('getValue') * 1;
            var weights = $("#Weight" + i).numberbox('getValue') * 1;

            var tonweight = (numbers * weights.toFixed(4)) / 1000;
            totalton += tonweight;
            total += numbers;
        });
        $("#TotalTon").numberbox('setValue', totalton);
        $("#Total").numberbox('setValue', total);
    }


    //计算金额
    function calculateAmount() {
        initDom();
        var triggerControl = this;
        var value = $(triggerControl).numberbox('getValue');

        //获取triggerControl的id的最后一个字符
        var id = $(triggerControl).attr("id");
        var lastChar = id.substr(id.length - 1, 1);
        var number = $("#CNumber" + lastChar).numberbox('getValue') * 1;
        var unitprice = $("#UnitPrice" + lastChar).numberbox('getValue') * 1;
        var amount = (number * unitprice).toFixed(2);
        $("#Amount" + lastChar).numberbox('setValue', amount);

        var totalAmount = 0.00;
        costdom.forEach(function (value, index) {
            var i = value;
            var numbers = $("#CNumber" + i).numberbox('getValue') * 1;
            var unitprices = $("#UnitPrice" + i).numberbox('getValue') * 1;

            var tonam = (numbers * unitprices).toFixed(2) * 1;
            totalAmount += tonam;
        });
        $("#Amount").numberbox('setValue', totalAmount);
    }

    function removecalculateAmount() {
        initDom();
        var totalAmount = 0.00;
        costdom.forEach(function (value, index) {
            var i = value;
            var numbers = $("#CNumber" + i).numberbox('getValue') * 1;
            var unitprices = $("#UnitPrice" + i).numberbox('getValue') * 1;

            var tonam = (numbers * unitprices).toFixed(2) * 1;
            totalAmount += tonam;
        });
        $("#Amount").numberbox('setValue', totalAmount);
    }

    function initCostType(row) {
        var id = row.did;
        $("#CostTypeId" + id).val(row.data.Id);//combobox('setValue', rowData.Id);
        $("#CostType" + id).combobox('setValue', row.data.CostTypeName);
        $("#ChargingUnit" + id).combobox('setValue', row.data.Unit);
        $("#UnitPrice" + id).numberbox('setValue', row.data.UnitPrice);
    }


    function editLKWarehouseAdjust() {
        var validate = $("#fm").form("validate")
        if (!validate) {
            return;
        }
        var data = {
            "Id": $("#Id").val(),
            "BillNo": $("#BillNo").textbox('getValue'),
            "AdjustTime": $("#AdjustTime").datebox('getValue'),
            "CustomerId": $("#CustomerId").combobox('getValue'),
            "CustomerNo": $("#CustomerId").combobox('getText'),
            "CustomerName": $("#CustomerName").textbox('getValue'),
            "TotalTon": $("#TotalTon").numberbox('getValue'),
            "Total": $("#Total").numberbox('getValue'),
            "Amount": $("#Amount").numberbox('getValue'),
            "IsByTon": $('#sbIsByTon').switchbutton('options').checked,
            "Remark": $("#Remark").val(),
        };

        initDom();
        var detailList = new Array();
        detaildom.forEach(function (value, index) {
            var i = value;
            var Id = $("#DetailId" + i).val();
            var AdjustId = $("#AdjustId" + i).val();
            var GoodsNo = $("#GoodsNo" + i).textbox('getValue');
            var GoodsId = $("#GoodsId" + i).val();
            var GoodsSpecId = $("#GoodsSpecId" + i).val();
            var GoodsName = $("#GoodsName" + i).textbox('getValue');
            var GoodsSpecName = $("#GoodsSpecName" + i).textbox('getValue');
            var Weight = $("#Weight" + i).numberbox('getValue');
            var number = $("#Number" + i).numberbox('getValue');
            var Area = $("#Area" + i).numberbox('getValue');
            var PlateNumber = $("#PlateNumber" + i).numberbox('getValue');
            var TonWeight = $("#TonWeight" + i).numberbox('getValue');
            var InventoryNumber = $("#InventoryNumber" + i).numberbox('getValue');

            var OutHouse = $("#OutHouse" + i).val();
            var OutHouseName = $("#OutHouseName" + i).textbox('getValue');



            var InHouse = $("#InHouse" + i).combobox('getValue');
            var InHouseName = $("#InHouse" + i).combobox('getText');
            var Remark1 = $("#Remark1" + i).textbox('getValue');
            var Remark2 = $("#Remark2" + i).textbox('getValue');
            var Remark3 = $("#Remark3" + i).textbox('getValue');

            var detail = {
                "Id": Id,
                "AdjustId": AdjustId,
                "GoodsNo": GoodsNo,
                "GoodsId": GoodsId,
                "GoodsName": GoodsName,
                "GoodsSpecId": GoodsSpecId,
                "GoodsSpecName": GoodsSpecName,
                "Weight": Weight,
                "Number": number,
                "Area": Area,
                "PlateNumber": PlateNumber,
                "TonWeight": TonWeight,
                "InventoryNumber": InventoryNumber,
                "OutHouse": OutHouse,
                "OutHouseName": OutHouseName,
                "InHouse": InHouse,
                "InHouseName": InHouseName,
                "Remark1": Remark1,
                "Remark2": Remark2,
                "Remark3": Remark3,
            };
            detailList.push(detail);
        });

        var costList = new Array();
        costdom.forEach(function (value, index) {
            var i = value;
            var Id = $("#CostsId" + i).val();
            var AdjustId = $("#AdjustId" + i).val();
            var CostId = $("#CostType" + i).combobox('getValue');
            var UnitPrice = $("#UnitPrice" + i).numberbox('getValue');
            var Unit = $("#ChargingUnit" + i).numberbox('getValue');
            var UnitName = $("#ChargingUnit" + i).combobox('getText');
            var number = $("#CNumber" + i).numberbox('getValue');
            var Amount = $("#Amount" + i).numberbox('getValue');

            var cost = {
                "Id": Id,
                "AdjustId": AdjustId,
                "CostId": CostId,
                "UnitPrice": UnitPrice,
                "Unit": Unit,
                "UnitName": UnitName,
                "Number": number,
                "Amount": Amount,
            };
            costList.push(cost);
        });

        var d = JSON.stringify({ WarehouseAdjust: data, Details: detailList, Costs: costList, AttachmentId: $("#hidFileId").val() });
        $.messager.progress({
            title: '请稍后',
            msg: '数据保存中...',
        });
        window.setTimeout(function () {
            $.ajax({
                url: '/GoodsOrder/EditLKWarehouseAdjust',
                type: "post",
                data: d,
                contentType: 'application/json; charset=utf-8',
                success: function (json) {
                    $.messager.progress('close');
                    Helper.Show(json.Msg);
                    if (json.Success) {
                        setTimeout(function () { window.location.href = "/GoodsOrder/LKWarehouseAdjustList"; }, 2000);
                    }
                }
            });
        }, 2000);
    }

</script>
<link href="~/Content/css/custome.css" rel="stylesheet" />
<div title="编辑商品调仓单" style="width:auto; height:auto; padding-left:5px; font-size:14px;  ">
    <div class="ftitle">
        @*<a href="javascript:" class="easyui-linkbutton" iconCls="icon-ok" style="height:32px" onclick="editLKWarehouseAdjust()">保存</a>*@
        <a href="/GoodsOrder/LKWarehouseAdjustList" class="easyui-linkbutton" iconCls="icon-back" style="height:32px">返回</a>
    </div>
    <form id="fm" method="post" novalidate>
        <input type="hidden" id="Id" value="@Model.WarehouseAdjust.Id" />
        <div class="ftitle">基础信息</div>
        <div class="fitem1">
            <label>
                调仓单编号:
            </label>
            <input class="easyui-textbox" id="BillNo" name="BillNo" value="@Model.WarehouseAdjust.BillNo" style="width: 173px; height: 30px;" readonly="readonly">
            <label>
                调仓时间:
            </label>
            <input id="AdjustTime" name="AdjustTime" value="@Model.WarehouseAdjust.AdjustTime.ToString("yyyy-MM-dd")" class="easyui-datebox" style="width: 173px; height: 30px;" />
            <label>
                客户:
            </label>
            <input id="CustomerId" value="@Model.WarehouseAdjust.CustomerId" class="easyui-combobox" data-options="prompt:'客户'" style="width: 173px; height: 30px;" />
            <label>
                客户名称:
            </label>
            <input class="easyui-textbox" id="CustomerName" name="CustomerName" value="@Model.WarehouseAdjust.CustomerName" style="width: 173px; height: 30px;" readonly="readonly">
        </div>
        <div class="fitem1">
            <label>
                总吨重:
            </label>
            <input id="TotalTon" name="TotalTon" value="@Model.WarehouseAdjust.TotalTon" class="easyui-numberbox" data-options="precision:'4',prompt:'总吨重'" style="width: 173px; height: 30px;" readonly="readonly" />
            <label>
                总件数:
            </label>
            <input id="Total" value="@Model.WarehouseAdjust.Total" class="easyui-numberbox" data-options="prompt:'总件数'" style="width: 173px; height: 30px;" />
            <label>
                总金额:
            </label>
            <input id="Amount" name="Amount" value="@Model.WarehouseAdjust.Amount" class="easyui-numberbox" data-options="precision:'2',prompt:'总金额'" style="width: 173px; height: 30px;" readonly="readonly" />
            <label>
                按吨操作:
            </label>
            <input class="easyui-switchbutton" id="sbIsByTon" value="@Model.WarehouseAdjust.IsByTon" data-options="onText:'是',offText:'否'">
        </div>
        <div class="fitem1">
            <label>
                图片:
            </label>
            <input type="hidden" id="hidFileId" />
            <input id="filebox" class="easyui-filebox" name="file" data-options="buttonText:'选择文件',accept:'image/*',onChange:fileChange" /><a href="@Model.FilePath" target="_blank">@Model.FileName</a>
        </div>
        <div class="fitem1">
            <label>
                备注:
            </label>
            <textarea rows="4" cols="4" style="width: 400px; height: 90px; vertical-align: top" name="Remark" id="Remark" autocomplete="off" placeholder="200字以内">@Model.WarehouseAdjust.Remark</textarea>
        </div>

        <div id="Wl">
            <div id="tabs" class="easyui-tabs" fit="true" border="false" style="width:500px;height:300px;">
                <div title="商品明细">
                    <input id="DomNum" type="hidden" value="@(Model.Details.Count+1)" />
                    @{
                        int i = 1;
                    }
                    <a href="javascript:" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="addDom()">添加</a>
                    <table class="gridtable" id="detailgird">
                        <thead>
                            <tr>
                                <th>商品批号</th>
                                <th>商品名称</th>
                                <th>规格名称</th>
                                <th>件重</th>
                                <th>数量</th>
                                <th>面积</th>
                                <th>板数</th>
                                <th>吨重</th>
                                <th>货存件数</th>
                                <th>转出仓位</th>
                                <th>转入仓位</th>
                                <th>备注1</th>
                                <th>备注2</th>
                                <th>备注3</th>
                                <th>操作</th>
                            </tr>
                            @foreach (var item in Model.Details)
                            {
                                <tr id="@i">
                                    <td>
                                        <input class="easyui-textbox" id="@("GoodsNo")@i" name="@("GoodsNo")@i" value="@item.GoodsNo" style="width: 173px; height: 30px;" readonly="readonly">
                                        <input type="hidden" id="@("DetailDomId")@i" value="@i" />
                                        <input type="hidden" id="@("DetailId")@i" value="@item.Id" />
                                        <input type="hidden" id="@("AdjustId")@i" value="@item.AdjustId" />
                                    </td>
                                    <td>
                                        <input class="easyui-textbox" id="@("GoodsName")@i" name="@("GoodsName")@i" value="@item.GoodsName" style="width: 173px; height: 30px;" readonly="readonly">
                                        <input type="hidden" id="@("GoodsId")@i" value="@item.GoodsId" />
                                    </td>
                                    <td>
                                        <input class="easyui-textbox" id="@("GoodsSpecName")@i" name="@("GoodsSpecName")@i" value="@item.GoodsSpecName" style="width: 173px; height: 30px;" readonly="readonly">
                                        <input type="hidden" id="@("GoodsSpecId")@i" value="@item.GoodsSpecId" />
                                    </td>
                                    <td><input id="@("Weight")@i" name="@("Weight")@i" value="@item.Weight" class="easyui-numberbox" data-options="precision:'4',prompt:'件重'" style="width: 173px; height: 30px;" readonly="readonly" /></td>
                                    <td><input id="@("Number")@i" name="@("Number")@i" value="@item.Number" class="easyui-numberbox" data-options="prompt:'数量'" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("Area")@i" name="@("Area")@i" value="@item.Area" class="easyui-numberbox" data-options="precision:'2',prompt:'面积'" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("PlateNumber")@i" class="easyui-numberbox" value="@item.PlateNumber" data-options="prompt:'板数'" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("TonWeight")@i" name="@("TonWeight")@i" value="@item.TonWeight" class="easyui-numberbox" data-options="precision:'4',prompt:'吨重'" style="width: 173px; height: 30px;" readonly="readonly" /></td>
                                    <td><input id="@("InventoryNumber")@i" class="easyui-numberbox" value="@item.InventoryNumber" data-options="prompt:'货存件数'" style="width: 173px; height: 30px;" /></td>
                                    <td>
                                        <input class="easyui-textbox" id="@("OutHouseName")@i" name="@("OutHouseName")@i" value="@item.OutHouseName" data-options="prompt:'转出仓位'" style="width: 173px; height: 30px;" readonly="readonly">
                                        <input type="hidden" id="@("OutHouse")@i" value="@item.OutHouse" />
                                    </td>
                                    <td><input id="@("InHouse")@i" class="easyui-combobox" value="@item.InHouse" data-options="prompt:'转入仓位'" style="width: 173px; height: 30px;" /></td>
                                    @*<td><input class="easyui-textbox" id="@("InHouseName")@i" name="@("InHouseName")@i" value="@item.InHouseName" style="width: 173px; height: 30px;" readonly="readonly"></td>*@
                                    <td><input class="easyui-textbox" id="@("Remark1")@i" name="@("Remark1")@i" value="@item.Remark1" style="width: 173px; height: 30px;"></td>
                                    <td><input class="easyui-textbox" id="@("Remark2")@i" name="@("Remark2")@i" value="@item.Remark2" style="width: 173px; height: 30px;"></td>
                                    <td><input class="easyui-textbox" id="@("Remark3")@i" name="@("Remark3")@i" value="@item.Remark3" style="width: 173px; height: 30px;"></td>
                                    <td><a href="javascript:" class="easyui-linkbutton" iconcls="icon-no" plain="true" style=" width:80px;" onclick="delDom(@i)">删除</a></td>
                                </tr>
                                i++;
                            }
                        </thead>
                    </table>
                    @{
                        i = 1;
                    }
                    @foreach (var item in Model.Details)
                    {
                        <script type="text/javascript">
$(function () {
                            InitInWareHouse(@i);
});
                        </script>
                        i++;
                    }
                </div>
                <div title="其他费用">
                    <input id="CostDomNum" type="hidden" value="@(Model.Costs.Count+1)" />
                    @{
                        int ci = 1;
                    }
                    <a href="javascript:" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="addDom2()">添加</a>
                    <table class="gridtable" id="costgird">
                        <thead>
                            <tr>
                                <th>费用类型</th>
                                <th>杂费单价</th>
                                <th>单位</th>
                                <th>计算数量</th>
                                <th>金额</th>
                                <th>操作</th>
                            </tr>
                            @foreach (var item in Model.Costs)
                            {
                                <tr id="@("CostTr")@ci">
                                    <td>
                                        <input id="@("CostType")@ci" class="easyui-combobox" value="@item.CostId" data-options="prompt:'费用类型',onChange:calculateAmount" style="width: 173px; height: 30px;" />
                                        <input type="hidden" id="@("CostTypeId")@ci" value="@item.CostId" />
                                        <input type="hidden" id="@("CostDomId")@ci" value="@ci" />
                                        <input type="hidden" id="@("CostsId")@ci" value="@item.Id" />
                                        <input type="hidden" id="@("AdjustId")@ci" value="@item.AdjustId" />
                                    </td>
                                    <td><input id="@("UnitPrice")@ci" name="@("UnitPrice")@ci" value="@item.UnitPrice" class="easyui-numberbox" data-options="precision:'2',prompt:'杂费单价',onChange:calculateAmount" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("ChargingUnit")@ci" class="easyui-combobox" value="@item.Unit" data-options="prompt:'单位'" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("CNumber")@ci" class="easyui-numberbox" value="@item.Number" data-options="prompt:'计算数量',onChange:calculateAmount" style="width: 173px; height: 30px;" /></td>
                                    <td><input id="@("Amount")@ci" name="@("Amount")@ci" value="@item.Amount" class="easyui-numberbox" data-options="precision:'2',prompt:'金额'" style="width: 173px; height: 30px;" /></td>
                                    <td><a href="javascript:" class="easyui-linkbutton" iconcls="icon-no" plain="true" style=" width:80px;" onclick="delDom2(@ci)">删除</a></td>
                                </tr>
                                ci++;
                            }
                        </thead>
                    </table>
                    @{
                        ci = 1;
                    }
                    @foreach (var item in Model.Costs)
                    {
                        <script type="text/javascript">
$(function () {
    InitCostTypesCombogrid2(@ci);
    InitChargingUnitCombobox(@ci);
});
                        </script>
                        ci++;
                    }
                </div>
            </div>
        </div>
        <div class="fitem1">
            @{
                var modifyuser = Model.WarehouseAdjust.ModifyUserId == 0 ? Gx.Dal.Shared.UserContext.CurrentUser.EmpName : Model.WarehouseAdjust.ModifyUser;
                var modifytime = Model.WarehouseAdjust.ModifyTime.ToString("yyyy-MM-dd") == "1911-01-01" ? "" : Model.WarehouseAdjust.ModifyTime.ToString("yyyy-MM-dd");
            }
            <label>
                制单人:
            </label>
            <label>
                @Model.WarehouseAdjust.CreateUser
            </label>

            <label>
                制单日期:
            </label>
            <label>
                @Model.WarehouseAdjust.CreateTime.ToString("yyyy-MM-dd")
            </label>
            <label>
                修改人:
            </label>
            <label>
                @modifyuser
            </label>
            <label>
                修改日期:
            </label>
            <label>
                @modifytime
            </label>
        </div>
    </form>
</div>
<div id="dlg" class="easyui-dialog" title="商品引导出库" data-options="iconCls:'icon-save'"
     closed="true" style="width: 1050px; height: auto; padding: 10px 20px" buttons="#dlg-buttons" modal="true">
    <table id="dg" class="easyui-datagrid" style="width:100%; height: auto;"
           url="/GoodsOrder/GetLKWarehouseEntryDetailsByCustomerId" toolbar="#tb" title="入库商品明细" rownumbers="true" pagination="true"
           pagelist="[15]" fitcolumns="true" singleselect="true">
        <thead>
            <tr>
                <th field="GoodsNo" align="right" width="10%">
                    商品批号
                </th>
                <th field="GoodsId" align="right" width="10%" hidden="hidden">
                    商品id
                </th>
                <th field="GoodsSpecId" align="right" width="10%" hidden="hidden">
                    规格
                </th>
                <th field="WareHouseId" align="right" width="10%" hidden="hidden">
                    仓位
                </th>
                <th field="GoodsName" align="right" width="10%">
                    商品名称
                </th>
                <th field="GoodsSpecName" align="right" width="10%">
                    规格名称
                </th>
                <th field="WareHouseName" align="right" width="10%">
                    仓库名称
                </th>
                <th field="Weight" align="right" width="10%">
                    件重
                </th>
                <th field="Number" align="right" width="10%">
                    件数
                </th>
                <th field="Area" align="right" width="10%">
                    面积
                </th>
                <th field="AvNumber" align="right" width="10%">
                    每板件数
                </th>
                <th field="TonWeight" align="right" width="10%">
                    吨重
                </th>
                <th field="PlateNumber" align="right" width="10%">
                    板数
                </th>
                <th field="ProductionDate" align="right" width="10%">
                    生产日期
                </th>
                <th field="ExpirationDate" align="right" width="10%">
                    保质日期
                </th>
                <th field="ProducingArea" align="right" width="10%">
                    产地
                </th>
                <th field="Remark" align="right" width="10%">
                    备注
                </th>
                <th field="Remark1" align="right" width="10%">
                    备注1
                </th>
                <th field="Remark2" align="right" width="10%">
                    备注2
                </th>
                <th field="Remark3" align="right" width="10%">
                    备注3
                </th>
            </tr>
        </thead>
    </table>
</div>
<div id="dlg-buttons">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="selectEntryDetail()">选择</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
</div>











